package com.example.disk.service;

import com.example.disk.domain.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpSession;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author auto
 * @since 2020-07-15
 */
public interface UserService extends IService<User> {
    //发送验证码
    boolean sendEmail(String email,int captcha);
    //是否存在该email
    boolean hasEmail(String email);
    //是否存在该账号
    boolean hasUsername(String username);
    //插入一条用户数据
    int insertOne(User user);
    //账号和密码是否输入正确
    boolean hasUserNameAndPsw(String account,String password);
    //根据账号取用户信息
    User getUserInfoByUserName(String username);
    //注销用户
    void logout(HttpSession session);
    //修改用户信息 包括昵称和密码
    boolean revise(int userId,String nickname,String password);
    //得到总存储空间
    int getTotalSize(int userId);
    int getUsedSize(int userId);

}
